import hexfield
import glgui2
from sqlite_utils import *
import pyglet

class Iconset:
    def __init__(self):
        dict =  sql_exec('SELECT * from graphics')
        self.atlas =  pyglet.image.atlas.TextureAtlas(1024,1024)
        self.dictionary = {}
        for name,icon in dict:
            self.dictionary[name] = self.atlas.add(pyglet.image.load('./graphics/icons/'+icon))
    def get_images(self,names):
        tmp = []
        for name in names:
            tmp.append(self.dictionary[name])
        return tmp
